import {BrowserModule} from '@angular/platform-browser';
/**
 * 打开 AppModule (app.module.ts) 并从 @angular/forms 库中导入 FormsModule 符号。
 */
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
/**
 * 要让 HttpClient 在应用中随处可用，
 * 请打开根模块 AppModule，
 * 从 @angular/common/http 中导入 HttpClientModule 符号，
 * 把它加入 @NgModule.imports 数组。
 */
import {AppRoutingModule} from './app-routing.module';
import {HttpClientModule} from "@angular/common/http";
import { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';

import {AppComponent} from './app.component';
import {HeroesComponent} from './heroes/heroes.component';
import {HeroDetailComponent} from './hero-detail/hero-detail.component';
import {MessagesComponent} from './messages/messages.component';
import {DashboardComponent} from './dashboard/dashboard.component';
import { HeroSearchComponent } from './hero-search/hero-search.component';
import {InMemoryDataService} from "./in-memory-data.service";

/**
 *
 * 每个组件都必须声明在（且只能声明在）一个 NgModule 中。
 ,
 HeroDetailComponent * HeroesComponent 也已经声明在了 @NgModule.declarations 数�,
    HeroSearchComponent��中。
 */
@NgModule({
  declarations: [
    AppComponent,
    HeroesComponent,
    HeroDetailComponent,
    MessagesComponent,
    DashboardComponent,
    HeroSearchComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    AppRoutingModule,
    HttpClientModule,
    HttpClientInMemoryWebApiModule.forRoot(InMemoryDataService,{dataEncapsulation: false})
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {
}
